<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
	body{font-size:12px;text-align:center}
	div{float:left;border:solid 1px #ccc;margin:8px;width:65px;height:65px;display:none}
	span{float:left;border:solid 1px #ccc;margin:8px;width:45px;height:45px;background-color:#eee}
</style>
<script type="text/javascript" src="../../../js/jquery-2.1.1.min.js"></script>
<script type="text/javascript">
	//包含给定文本的选择器
	$(function(){
		$("div:contains('A')").css("display","block");
	})
	//不包含子元素或者文本的空元素
	$(function(){
		$("div:empty").css("display","block");		
	})
	//含有选择器所匹配的文本元素
	$(function(){
		$("div:has(span)").css("display","block");
	})
	//获取含有子元素或者文本的元素
	$(function(){
		$("div:parent").css("display","block");
	})
</script>
</head>
<body>
	<div>ABCD</div>
	<div><span></span></div>
	<div>EFaH</div>
	<div></div>
</body>
</html>